package com.itbaizhan.dao.impl;

import com.itbaizhan.dao.HotProductDao;
import com.itbaizhan.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author spf
 * @date 2024/3/4
 * @time 10:29
 */
@Repository
public class HotProductDaoImpl implements HotProductDao {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public List<Item> selectItems(Query query) {
        return mongoTemplate.find(query, Item.class);
    }
}
